/*
 * Copyright 2011 Subhabrata Ghosh <subho.ghosh at langene.net>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */



package net.langene.nlp.model;

//~--- JDK imports ------------------------------------------------------------

import java.util.LinkedList;
import java.util.List;

//~--- classes ----------------------------------------------------------------

/**
 *
 * @author Subhabrata Ghosh <subho.ghosh at langene.net>
 */
public class SentenceGraphNode {
    private List<SentenceGraphNode>	children = null;
    private AbstractSentenceMarker	marker;
    private Sentence			part;

    //~--- constructors -------------------------------------------------------

    /**
     * 
     * @param part
     */
    public SentenceGraphNode(Sentence part) {
        this.part = part;
    }

    //~--- methods ------------------------------------------------------------

    /**
     * Add a child node.
     * 
     * @param child
     */
    public void addChild(SentenceGraphNode child) {
        if (getChildren() == null) {
            children = new LinkedList<SentenceGraphNode>();
        }

        getChildren().add(child);
    }

    @Override
    public String toString() {
        return "SentenceGraphNode{" + "part=" + getPart() + '}';
    }

    //~--- get methods --------------------------------------------------------

    /**
     * @return the children
     */
    public List<SentenceGraphNode> getChildren() {
        return children;
    }

    /**
     * @return the part
     */
    public Sentence getPart() {
        return part;
    }

    /**
     * @return the marker
     */
    public AbstractSentenceMarker getMarker() {
        return marker;
    }

    //~--- set methods --------------------------------------------------------

    /**
     * @param marker the marker to set
     */
    public void setMarker(AbstractSentenceMarker marker) {
        this.marker = marker;
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
